package com.csun.cmny.provider.model.dto.customerArchives;

import com.csun.cmny.provider.validator.OmcMonitorLogValidator;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
public class OldmanArchivesDto {

    /*老人名字*/
    @NotEmpty(message = "{Archives.oldName.null}")
    private String oldName;

    /*性别 0-男 1-女*/
    @NotNull(message = "{Archives.sex.null}")
    private Integer sex;

    /*合同编号*/
    @NotEmpty(message = "{Archives.contractNo.null}")
    private String contractNo;

    /*合同开始时间*/
    @NotEmpty(message = "{contract.date.null.start}")
    @Size(min = 1, max = 10, message = "{Monitorlog.date.length.error}",groups = {OmcMonitorLogValidator.class})
    @Pattern(regexp="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message="{Advisory.date.pattem.error}")
    private String startDate;

    /*合同结束时间*/
    @NotEmpty(message = "{contract.date.null.end}")
    @Size(min = 1, max = 10, message = "{Monitorlog.date.length.error}",groups = {OmcMonitorLogValidator.class})
    @Pattern(regexp="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message="{Advisory.date.pattem.error}")
    private String endDate;

    /*老人身份证号*/
    @NotEmpty(message = "{contract.idCard.null}")
    private  String oldIdCard;

    /*老人出生日期*/
    @NotEmpty(message = "{Archives.birthday.null}")
    @Size(min = 1, max = 10, message = "{Monitorlog.date.length.error}",groups = {OmcMonitorLogValidator.class})
    @Pattern(regexp="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message="{Advisory.date.pattem.error}")
    private String birthday;


    /*老人年龄*/
    @NotNull(message = "{Archives.age.null}")
    private Integer oldAge;


    /*血型*/
    private String bloodType;

    /*老人联系电话*/
    @Pattern(regexp = "^((\\+86)|(86))?(13|15|16|17|18|19)\\d{9}$",
            message = "{contract.phone.error}")
    @NotEmpty(message = "{contract.phone.null}")
    private String oldPhone;

    /*图片code*/
    private  String pictureCode;

    /*老人居住地址*/
    private String oldAddress;
}
